package cn.ffcs.bpmpvc.dao.impl;

import java.util.ArrayList;
import java.util.List;

import org.apache.commons.lang.StringUtils;
import org.echoice.hibernate.HibernateEntityDao;
import org.echoice.paper.PageBean;

import cn.ffcs.bpmpvc.dao.DocTempleteDao;
import cn.ffcs.bpmpvc.model.PocDocTemplete;

public class DocTempleteDaoImpl extends HibernateEntityDao<PocDocTemplete> implements DocTempleteDao{
	public PageBean queryPageDocTempleteList(PocDocTemplete pocDocTemplete,int pageNo,int pageSize){
		String hql="select t from PocDocTemplete t where 1=1";
		
		List paramList=new ArrayList();
		if(pocDocTemplete!=null){
			if(StringUtils.isNotBlank(pocDocTemplete.getFileName())){
				hql+=" and t.fileName like ?";
				paramList.add("%"+pocDocTemplete.getFileName()+"%");
			}
		}
		hql+=" order by t.fileId desc";
		return pagedQueryHQL(hql, pageNo, pageSize, paramList.toArray());
	}
	
}
